package com.yhy.wxzn.wcs.wcsWmsCommunication.dto;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.Date;
import java.util.List;

public class WmsResonsesNodeDto {


    /**
     * returnStatus : 0成功 1失败
     * returnInfo : 失败原因
     * msgTime  : 2020-07-14 02:51:33.379
     */
    private Integer returnStatus;

    private String returnInfo;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss.SSS")
    private Date msgTime;

    List<NodeDto> data;

    public WmsResonsesNodeDto(Integer returnStatus, String returnInfo, Date msgTime, List<NodeDto> nodeDtos) {
        this.returnStatus = returnStatus;
        this.returnInfo = returnInfo;
        this.msgTime = msgTime;
        data = nodeDtos;
    }

    public WmsResonsesNodeDto() {
    }

    public Integer getReturnStatus() {
        return returnStatus;
    }

    public void setReturnStatus(Integer returnStatus) {
        this.returnStatus = returnStatus;
    }

    public String getReturnInfo() {
        return returnInfo;
    }

    public void setReturnInfo(String returnInfo) {
        this.returnInfo = returnInfo;
    }

    public Date getMsgTime() {
        return msgTime;
    }

    public void setMsgTime(Date msgTime) {
        this.msgTime = msgTime;
    }

    public List<NodeDto> getData() {
        return data;
    }

    public void setData(List<NodeDto> data) {
        this.data = data;
    }

    /**
     * 失败
     * @param returnInfo
     * @param NodeDtos
     * @return
     */
    public static WmsResonsesNodeDto returnError(String returnInfo,List<NodeDto>  NodeDtos) {
        return new WmsResonsesNodeDto(1, returnInfo, new Date(),NodeDtos);
    }

    /**
     * 成功
     * @param returnInfo
     * @param NodeDtos
     * @return
     */
    public static WmsResonsesNodeDto returnSuccess(String returnInfo,List<NodeDto>  NodeDtos) {
        return new WmsResonsesNodeDto(0, returnInfo, new Date(),NodeDtos);
    }
}
